<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="xqye.css">
</head>
<body>
    <div class="shortcut">
        <div class="shortcut-con">
            <ul class="s-left">
                <li>
                    <a href="https://www.vmall.com/">首页</a>
                    <a href="https://consumer.huawei.com/cn/">华为官网</a>
                    <a href="https://club.huawei.com/">花粉俱乐部</a>
                    <a href="https://www.vmall.com/priority">V码(优购码)</a>
                    <a href="https://www.vmall.com/company" target="_blank">企业购</a>
                    <a href="javascript:;">Select Region</a>
                    <a href="">更多精彩</a>
                </li>
            </ul>
            <div class="s-right">
                <a id="top-index-loginUrl">请登录</a>
                <a href="https://id1.cloud.huawei.com/CAS/portal/userRegister/regbyphone.html?service=https://www.vmall.com/account/caslogin&amp;loginChannel=26000000&amp;reqClientType=26&amp;lang=zh-cn">&nbsp;&nbsp;注册</a>
                <a href="">我的订单</a>
                <a href="">客户服务</a>
                <a href="">网站导航</a>
                <a href="">手机版</a>
                <a href="">购物车</a>
            </div>
        </div>
    </div>
    <div class="header">
        <div class="header-con">
            <div class="h-left">
                <div class="logo">
                    <a href="https://www.vmall.com/index.html" title="华为商城" onclick="pushIndexLogoClickMsg('https\x3A\x2F\x2Fres.vmallres.com\x2Fpimages\x2F\x2Fcommon\x2Fconfig\x2Flogo\x2FSXppnESYv4K11DBxDFc2.png','https\x3A\x2F\x2Fwww.vmall.com\x2Findex.html')">
						<img src="https://res.vmallres.com/pimages//common/config/logo/SXppnESYv4K11DBxDFc2.png" alt="华为商城">
					</a>
                </div>
                <ul>
                    <li>
                        <a href="https://sale.vmall.com/huaweizone.html" target="_blank">华为专区</a>
                        <a href="">莫塞尔专区</a>
                        <a href="">华为自选</a>
                        <a href="">鸿蒙智联</a>
                        <a href="">福利中心</a>
                    </li>
                </ul>
            </div>
            <form action="" method="get">
                <input type="password">
                <img src="images/www.vmall_03_03.jpg" alt="">
                <div>
                    <a href="javascript:void(0);" onclick="searchFunc('MatePad\x2011'); return false;" rel="nofollow">MatePad 11</a>
                <a href="javascript:void(0);" onclick="searchFunc('Nova\x208'); return false;" rel="nofollow">Nova 8</a>
                </div>
            </form>
        </div>
    </div>
    <div class="g">
        <div class="g-con">
            <a href="">首页&nbsp;>&nbsp;</a>
            <a href="">手机&nbsp;>&nbsp;</a>
            <a href="">HUAWEI Mate系列&nbsp;>&nbsp;</a>
            <a href="">HUAWEI Mate 40 5G 全网通 8GB+128GB（亮黑色）5nm麒麟9000E旗舰芯片 40W有线无线双超级快充 超感知徕卡影像</a>
        </div>
    </div>
    <div class="pro">
        <div class="pro-con">
            <div class="pro-left">
                <img src="images/phone.png" alt="" id="pic">
            </div>
            <div class="pro-right">
                <h1 id="title">HUAWEI Mate 40 5G 全网通 8GB+128GB（亮黑色）5nm麒麟9000E旗舰芯片 40W有线无线双超级快充 超感知徕卡影像</h1>
                <a href="">【每周二/四/六 10:08 限量发售】FreeBuds 系列真无线耳机 最高享6期免息 点击了解 》》》</a>
                <div class="pri">
                    <div class="ri">
                        <p>价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格</p><span id="price">￥4999</span>
                    </div>
                    <div class="ti">
                        <p>促&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;销</p><span>购买即赠商城积分，积分可抵现~</span>
                    </div>
                </div>
                <div class="uo">
                    <p>服务说明</p>
                    <span>已满48元已免运费</span>
                    <span>由华为商城提供商品、发货开票及售后服务</span>
                </div>
                <div class="ul">
                    <p>商品编号</p><span id="one">2601010245501</span>
                </div>
                <div class="we">
                    <span class="cut">-</span><input type="text" id="num" value="1"><span class="add">+</span>
                    <input type="button" value="加入购物车" id="btn">
                    <a href="cart.html">购物车</a>
                </div>
            </div>
        </div>
    </div>
    <script src="jquery-1.12.4.min.js"></script>
            <script>
                $('#btn').click(function(){
                    $.ajax({
                        url:"http://localhost/interface/add.php",
                        data:{
                            id:$('#one').text(),
                            name:$('#title').text(),
                            img:$('#pic').attr('src'),
                            price:$('#price').text(),
                            num:$('#num').val()
                        },
                        success:function(res){
                            // console.log(res);
                            if(res.code==1){
                                alert('商品加入成功');
                            }
                        },
                        dataType:'json'
                    })
                })
            </script>
</body>
</html>